package Test;

public class Test01 {

	public static void main(String[] args) {
		
		
		Person p = new Student("小明",26);
		p.eat();//多态 
	}

}

abstract class Person{
	
	String name;
	int age;
	
	public Person() {
		super();
	}

	public Person(String name, int age) {
		super();
		this.name = name;
		this.age = age;
	}
	
	public abstract void eat();
	
}

class Student extends Person{

	
	
	public Student() {
		super();
	}

	public Student(String name, int age) {
		super(name, age);
	}

	@Override
	public void eat() {
		
		System.out.println("学生吃饭");
	}
	
	
}
